unit Aberturadodia;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Mask;

type
  TFormAberturaDia = class(TForm)
    ComboBox1: TComboBox;
    Label3: TLabel;
    Label5: TLabel;
    MaskEdit1: TMaskEdit;
    BitBtn1: TBitBtn;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    MaskEdit2: TMaskEdit;
    procedure FormShow(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormAberturaDia: TFormAberturaDia;

implementation

uses principal,funcoesapoio;

{$R *.dfm}

procedure TFormAberturaDia.FormShow(Sender: TObject);
var i:integer;
begin
        CapturaDadosProgamadosECF(2); // Captura Meios de Pagamento
        for i:=1 to 20 do begin
                if not (MeiosPagamento[i].Legenda='') then Combobox1.Items.ADD(MeiosPagamento[i].Legenda);
        end;
        try
                ComboBox1.Text:=MeiosPagamento[1].Legenda;
        except
        end;

        if FormAberturaDia.Height=211 then begin
                Label3.Visible:=true; Combobox1.Visible:=true;
                Label1.Visible:=true; Edit1.Visible:=True;
                Label2.Visible:=true; MaskEdit2.Visible:=True;
        end
        else if FormAberturaDia.Height=168 then begin
                Label3.Visible:=true; Combobox1.Visible:=true;
                Label1.Visible:=true; Edit1.Visible:=True;
                Label2.Visible:=false; MaskEdit2.Visible:=false;
        end
        else if FormAberturaDia.Height=68 then begin
                Label3.Visible:=false; Combobox1.Visible:=false;
                Label1.Visible:=false; Edit1.Visible:=false;
                Label2.Visible:=false; MaskEdit2.Visible:=false;
        end
        else begin
                Label3.Visible:=true; Combobox1.Visible:=true;
                Label1.Visible:=false; Edit1.Visible:=false;
                Label2.Visible:=false; MaskEdit2.Visible:=false;
        end

end;

procedure TFormAberturaDia.BitBtn1Click(Sender: TObject);
var valor:string;
begin
        valor:=Maskedit1.Text; virgula:=pos(',',valor);
        Delete(valor, virgula, 1);
        FormPrincipal.ValorInicioDia:=valor;
        FormPrincipal.PagtoInicioDia:=ComboBox1.Text;
        FormPrincipal.TextoPagamento:=Edit1.Text;
        FormPrincipal.Parcelas:=MaskEdit1.Text;
end;

procedure TFormAberturaDia.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
        HabilitaDesabilitaItensMenu(1);// Habilita os menus
        FormPrincipal.cursor:=crDefault;
end;

end.
